<template>
  <div id="search-page">
    <div class="container">
      <div class="header">搜索</div>
      <div class="hint">搜索 合集、艺术品、用户</div>
      <div class="search-box">
        <el-input
          placeholder="请输入内容"
          prefix-icon="el-icon-search"
          v-model="keyword"
        >
        </el-input>
        <el-button
          @click="LinkToSearch"
          type="primary"
          icon="el-icon-search"
        ></el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "SearchPage",
  data() {
    return {
      keyword: "",
    };
  },
  methods: {
    // 搜索
    LinkToSearch() {
      this.$router.push(`/search?keyword=${this.keyword}`);
      // 清空
      this.keyword = "";
    },
  },
};
</script>

<style lang='less' scoped>
#search-page {
  .container {
    margin: 20px auto;
    max-width: 800px;
    padding: 0 30px;
    .header {
      font-size: 20px;
    }
    .hint {
      font-size: 14px;
      color: #999;
    }
    .search-box {
      margin-top: 10px;
      display: flex;
    }
  }
}
</style>